package com.ds.infrastructure.audit.common.exception;

import lombok.Getter;

/**
 * 作用：
 *
 * @author WeiShaoying
 * @date 2020/8/6
 */
@Getter
public class ApiException extends RuntimeException {

    private static final long serialVersionUID = -7368329039978815752L;

    private int code;

    private String msg;

    /**
     * Constructs a new runtime exception with {@code null} as its
     * detail message.  The cause is not initialized, and may subsequently be
     * initialized by a call to {@link #initCause}.
     */
    public ApiException() {
    }

    /**
     * Constructs a new runtime exception with the specified detail message.
     * The cause is not initialized, and may subsequently be initialized by a
     * call to {@link #initCause}.
     *
     * @param msg the detail message. The detail message is saved for
     *            later retrieval by the {@link #getMessage()} method.
     */
    public ApiException(int code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }


}
